
using SimpleORM.Infrastructure;
using SimpleORM.Repository.IRepository;
using SimpleORM.Repository.Repository;
using SimpleORM.Service.IService;
using SimpleORM.Service.Service;
using System.Text;
namespace SimpleORM
{
    public class Program
    {
        public static void Main(string[] args)
        {
            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
            var builder = WebApplication.CreateBuilder(args);

            // Add services to the container.

            builder.Services.AddControllers();
            // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
            builder.Services.AddEndpointsApiExplorer();
            builder.Services.AddSwaggerGen();
            //builder.Services.AddScoped<IGetuser, Getuser>();
            builder.Services.AddScoped<IGenerateoneService, GenerateoneService>();
            //builder.Services.AddScoped<IProductRepository, ProductRepository>();
            builder.Services.AddSYSSetUp(builder.Configuration);
            builder.Services.AddHttpClient();
            var app = builder.Build();

            // Configure the HTTP request pipeline.
            if (app.Environment.IsDevelopment())
            {
                app.UseSwagger();
                app.UseSwaggerUI();
            }
            app.UseHttpsRedirection();

            app.UseAuthorization();

            app.UseProgramMiddleware();

            app.MapControllers();

            app.Run();
        }
    }
}
